<!DOCTYPE html>
<!-- saved from url=(0054)https://xie.infoq.cn/article/0e36ad9712c8d9ad8f7a7c570 -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script async="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/1.gif"></script>
<!-- <geektime>1591721646652</geektime> -->
    
    
        <title>NIO看破也说破（一）—— Linux/IO基础_Linux_小眼睛聊技术_InfoQ写作社区</title>
        <meta name="description" content="Tips：Linux底层通过文件的方式实现IOJava等高级语言是通过syscall对Linux系统函数进行调用来实现网络通信知识准备Linux中一切类型都被抽象成文件，如：普通文件、目录、字符设备、" id="metadesc">
    
    <meta name="keywords" content="netty,NIO,IO,Linux,看破,说破,基础,底层,文件,方式,Java,调用,函数,文章,目的,揭示,网络,理解,多路复用,reactor" id="metakeywords">
    <meta property="og:image" content="https://static001.infoq.cn/static/write/img/write-favicon.jpg">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    
        <link rel="icon" type="image/png" sizes="32x32" href="https://static001.infoq.cn/static/write/img/write-favicon.jpg">
        <link rel="icon" type="image/png" sizes="16x16" href="https://static001.infoq.cn/static/write/img/write-favicon.jpg">
    
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="format-detection" content="telephone=no">
    <meta name="applicable-device" content="pc,mobile">
    <meta http-equiv="Cache-Control" content="no-transform">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <link rel="canonical" href="https://xie.infoq.cn/article/0e36ad9712c8d9ad8f7a7c570">
    <meta property="og:title" content="NIO看破也说破（一）—— Linux/IO基础_Linux_小眼睛聊技术_InfoQ写作社区">
    <meta property="og:url" content="https://xie.infoq.cn/article/0e36ad9712c8d9ad8f7a7c570">
    <meta property="og:description" content="Tips：Linux底层通过文件的方式实现IOJava等高级语言是通过syscall对Linux系统函数进行调用来实现网络通信知识准备Linux中一切类型都被抽象成文件，如：普通文件、目录、字符设备、">

    <script type="text/javascript" async="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/js"></script><script type="text/javascript" async="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/js(1)"></script><script async="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/sensorsdata.min.js.下载" charset="UTF-8"></script><script src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/hm.js.下载"></script><script src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/hm(1).js.下载"></script><script async="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/analytics.js.下载"></script><script src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/push.js.下载"></script><script type="text/javascript" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/jweixin-1.4.0.js.下载"></script>
    <script type="text/javascript" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/bufferLogger.1.0.8.min.js.下载"></script>
    <script src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/dingtalk.open.js.下载"></script>
    
        <script type="text/javascript" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/aliplayer-min.js.下载"></script>
        <script type="text/javascript" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/hls.8361666e7e2690d988ff5fe775b62bbe.js.下载"></script>
    
        
    <script src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/jquery-1.12.4.min(1).js.下载"></script>
    
    <script src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/mantis.min.js.下载"></script>
    <script type="text/javascript">
        if (!('flex' in document.documentElement.style) && !navigator.userAgent.match(/spider|googlebot|bingbot|geekbang|yahoo! Slurp/i)) {
            window.location.href = '//static001.geekbang.org/static/common/browser_update/index.html'
        }
    </script>
    <script>
        (function(){
            var bp = document.createElement('script');
            var curProtocol = window.location.protocol.split(':')[0];
            if (curProtocol === 'https'){
                bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
            }
            else{
                bp.src = 'http://push.zhanzhang.baidu.com/push.js';
            }
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(bp, s);
        })();
    </script>
<link href="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/app.f787f7a6.css" rel="stylesheet"><script src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/1725952827-mantis_probe.min.js.下载" type="text/javascript" defer=""></script><meta name="referrer" content="no-referrer-when-downgrade"><script charset="utf-8" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/chunk-codemirror.5b03effd.js.下载"></script><link rel="stylesheet" type="text/css" href="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/chunk-katex.ce0dccd9.css"><script charset="utf-8" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/chunk-katex.7cd46588.js.下载"></script><link rel="stylesheet" type="text/css" href="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/chunk-geek-editor.b88154cf.css"><script charset="utf-8" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/chunk-geek-editor.9ca1b5f5.js.下载"></script><link rel="stylesheet" type="text/css" href="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/chunk-12b29e91.053549ea.css"><script charset="utf-8" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/chunk-12b29e91.1598f130.js.下载"></script><link rel="stylesheet" type="text/css" href="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/PageArticle.76a73b25.css"><script charset="utf-8" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/PageArticle.9509fe6c.js.下载"></script></head>

<body>
<div data-v-b110a92e="" data-v-4a1c10f0="" id="layout" layout="" class="page-article-layout ready skin-base size-base" style="padding-bottom: 0px;"><div data-v-b110a92e="" layout-header-wrap="" class="layout-header-wrap"><div data-v-2c781bfe="" data-v-b110a92e="" class="common-header-pc"><div data-v-2c781bfe="" class="shim"></div><div data-v-2c781bfe="" class="header"><div data-v-2c781bfe="" class="wrap"><div data-v-2c781bfe="" class="layout-content header-content"><div data-v-2c781bfe="" class="logo"><a data-v-2c781bfe="" href="https://www.infoq.cn/" class="main-logo"><img data-v-2c781bfe="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/logo.b51e49df.png" alt="logo"></a><a data-v-2c781bfe="" href="https://xie.infoq.cn/" class="sub-logo"><img data-v-2c781bfe="" src="" alt="logo"></a></div><div data-v-2c781bfe="" class="header-middle"><div data-v-2c781bfe="" class="nav"><ul data-v-2c781bfe=""><li data-v-2c781bfe=""><a data-v-2c781bfe="" href="https://xie.infoq.cn/" class="">首页</a></li><li data-v-2c781bfe=""><!----><a data-v-2c781bfe="" href="https://xie.infoq.cn/square/13" target="_blank" rel="" class=""> 玩转社区 </a></li><li data-v-2c781bfe=""><!----><a data-v-2c781bfe="" href="https://xie.infoq.cn/tag/3" target="_blank" rel="" class=""> Java </a></li><li data-v-2c781bfe=""><!----><a data-v-2c781bfe="" href="https://xie.infoq.cn/tag/211" target="_blank" rel="" class=""> 开源 </a></li><li data-v-2c781bfe=""><!----><a data-v-2c781bfe="" href="https://xie.infoq.cn/tag/238" target="_blank" rel="" class=""> 架构 </a></li><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----></ul><div data-v-2c781bfe="" class="more"> 全部标签 <i data-v-2c781bfe="" class="iconfont"></i></div></div><div data-v-2c781bfe="" class="search-container"><div data-v-2c781bfe="" class="search-wrap"><input data-v-2c781bfe="" type="text" placeholder="搜索" class="search-input"><span data-v-2c781bfe="" class="search-btn iconfont"></span></div></div><!----><div data-v-2c781bfe="" class="write-btn-warp"><div data-v-2c781bfe="" gk-button="" gkbtn-color="green" gkbtn-size="small" class="write-btn Button_button_3onsJ"> 写点什么 </div><div data-v-2c781bfe="" class="scene" style="display: none;"><h4 data-v-2c781bfe=""><i data-v-2c781bfe="" class="iconfont"></i>创作场景</h4><div data-v-2c781bfe="" class="close"><i data-v-2c781bfe="" class="iconfont"></i></div><ul data-v-2c781bfe=""><li data-v-2c781bfe="">记录自己日常工作的实践、心得</li><li data-v-2c781bfe="">发表对生活和职场的感悟</li><li data-v-2c781bfe="">针对感兴趣的事件发表随笔或者杂谈</li><li data-v-2c781bfe="">从0到1详细介绍你掌握的一门语言、一个技术，或者一个兴趣、爱好</li><li data-v-2c781bfe="">或者，就直接把你的个人博客、公众号直接搬到这里</li></ul></div></div></div><div data-v-2c781bfe="" class="account"><span data-v-2c781bfe="" class="route">登录</span><span data-v-2c781bfe="" class="line"></span><span data-v-2c781bfe="" class="route">注册</span></div></div></div><div data-v-2c781bfe="" class="more-tags"><div data-v-2c781bfe="" class="inner-content"><div data-v-4300d745="" data-v-2c781bfe="" class="com-label-list"><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/9434" com-label-title="" class="com-label-title">OpenHarmony</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/303" com-label-title="" class="com-label-title">算法</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/14135" com-label-title="" class="com-label-title">元宇宙</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/84" com-label-title="" class="com-label-title">MySQL</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/5237" com-label-title="" class="com-label-title">移动开发</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/221" com-label-title="" class="com-label-title">学习方法</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/221" com-label-title="" class="com-label-title">学习方法</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/17178" com-label-title="" class="com-label-title">Web3.0</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/203" com-label-title="" class="com-label-title">高效工作</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/92" com-label-title="" class="com-label-title">数据库</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/8" com-label-title="" class="com-label-title">Python</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/661" com-label-title="" class="com-label-title">音视频</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/371" com-label-title="" class="com-label-title">前端</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/242" com-label-title="" class="com-label-title">AI</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/143" com-label-title="" class="com-label-title">大数据</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/204" com-label-title="" class="com-label-title">团队管理</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/232" com-label-title="" class="com-label-title">程序员</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/317" com-label-title="" class="com-label-title">运维</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/200" com-label-title="" class="com-label-title">深度思考</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/1081" com-label-title="" class="com-label-title">低代码</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/97" com-label-title="" class="com-label-title">redis</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/19" com-label-title="" class="com-label-title">golang</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/294" com-label-title="" class="com-label-title">微服务架构</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/21" com-label-title="" class="com-label-title">flutter</a><a data-v-2c781bfe="" data-v-4300d745="" href="https://xie.infoq.cn/tag" target="_blank" class="more-tag com-label-title"> 查看更多 <i data-v-2c781bfe="" data-v-4300d745="" class="iconfont"></i></a></div></div></div></div></div></div><div data-v-b110a92e="" inner-content="" class="inner-content"><!----><!----><!----><div data-v-4a1c10f0="" data-v-b110a92e="" class="layout-content article-content"><div data-v-4a1c10f0="" class="article-fixed-wrap" data-v-b110a92e="" style="width: 150px;"><div data-v-4a1c10f0="" class="side-operation" style="top: 91px;"><div data-v-4a51d84b="" data-v-4a1c10f0="" class="widget-operation side" authorinfo="[object Object]" wxshareurl="https://xie.infoq.cn/article/0e36ad9712c8d9ad8f7a7c570"><div data-v-4a51d84b="" class="toggle-menu btn"><i data-v-4a51d84b="" class="iconfont"></i></div><div data-v-4a51d84b="" class="like btn"><i data-v-4a51d84b="" class="iconfont"></i><i data-v-4a51d84b="" class="like-num">11</i></div><div data-v-4a51d84b="" class="favorite btn"><i data-v-4a51d84b="" class="iconfont"></i></div><div data-v-4a51d84b="" class="comment btn"><i data-v-4a51d84b="" class="iconfont"></i></div><div data-v-4a51d84b="" class="weixin btn"><span data-v-4a51d84b="" class="gkui-popup share-popup-left share-popup"><i data-v-4a51d84b="" class="iconfont"></i><!----></span></div><div data-v-4a51d84b="" class="weibo btn"><i data-v-4a51d84b="" class="iconfont"></i></div><div data-v-4a51d84b="" class="horde btn"><i data-v-4a51d84b="" class="iconfont"></i></div><!----><!----></div></div></div><div data-v-4a1c10f0="" data-v-b110a92e="" class="main"><!----><!----><h1 data-v-4a1c10f0="" data-v-b110a92e="" class="article-title">NIO 看破也说破（一）—— Linux/IO 基础</h1><div data-v-4a1c10f0="" data-v-b110a92e="" class="author-information"><div data-v-4a1c10f0="" data-v-b110a92e="" class="row"><div data-v-4a1c10f0="" data-v-b110a92e="" class="author-name"> 作者：<span data-v-3bc80670="" data-v-6281d13f="" data-v-4a1c10f0="" class="ctn" data-v-b110a92e=""><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">小眼睛聊技术</a><!----></span></div></div><div data-v-4a1c10f0="" data-v-b110a92e="" class="row article-head"><ul data-v-4a1c10f0="" data-v-b110a92e="" class="read-time"><li data-v-4a1c10f0="" data-v-b110a92e="">2020-05-05  <!----></li><li data-v-4a1c10f0="" data-v-b110a92e=""><p data-v-4a1c10f0="" data-v-b110a92e="" class="time-style">本文字数：2108 字 </p><!----><p data-v-4a1c10f0="" data-v-b110a92e="" class="time-style">阅读完需：约 7 分钟</p></li></ul></div></div><div data-v-4a1c10f0="" data-v-b110a92e="" class="article-cover"><img data-v-4a1c10f0="" data-v-b110a92e="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/0bfe6f922e54b69acb47e191cf1ec8f4.jpeg" alt="NIO看破也说破（一）—— Linux/IO基础"></div><div data-v-4a1c10f0="" data-v-b110a92e="" class="article-detaile"><div data-v-fbbc0218="" data-v-4a1c10f0="" class="article-preview-content size-base" data-v-b110a92e=""><div data-v-fbbc0218="" data-type="doc" class="article-preview"><div contenteditable="false" translate="no" class="ProseMirror"><blockquote data-type="blockquote"><p data-type="paragraph"><span data-size="12" data-type="size">Tips：</span></p><ol data-type="numberedlist"><li><p data-number="1" data-type="paragraph"><span data-size="12" data-type="size">Linux 底层通过文件的方式实现 IO</span></p></li><li><p data-number="2" data-type="paragraph"><span data-size="12" data-type="size">Java 等高级语言是通过 syscall 对 Linux 系统函数进行调用来实现网络通信</span></p></li></ol></blockquote><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><h3 data-id="heading0" data-type="heading" top="342.25">知识准备</h3><ol data-type="numberedlist"><li><p data-number="1" data-type="paragraph">Linux 中一切类型都被抽象成文件，如：普通文件、目录、字符设备、块设备、套接字等</p></li><li><p data-number="2" data-type="paragraph">内存被划分为内核态和用户态，数据在用户态和内核态之间拷贝，内核态可以访问用户态数据，反之不可以</p></li><li><p data-number="3" data-type="paragraph">只有内核可以操作硬件资源（网卡、磁盘等），内核提供 syscall 函数</p></li></ol><h3 data-id="heading1" data-type="heading" top="502.25">文件描述符</h3><ol data-type="numberedlist"><li><p data-number="1" data-type="paragraph">文件描述符是内核创建的方便管理已打开文件的索引，指代被打开的文件。当程序打开一个现有文件或者创建一个新文件时，内核向进程返回一个文件描述符。</p></li></ol><div data-type="image"><div data-content="" data-style-width="100%" data-style-bordertype="boxShadow"><img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/cc8a4e43a02d7deccf1ae578a61a677f.png"> <!----></div></div><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><ol start="2" data-type="numberedlist"><li><p data-number="2" data-type="paragraph">所有执行 I/O 操作的系统调用都通过文件描述符</p></li></ol><p data-type="paragraph">在 Linux 系统中，ssh 方式登录后查看/proc 下信息，可以看到系统为每一个进程默认创建 0，1，2 三个 fd</p><div data-type="image"><div data-content="" data-style-width="100%" data-style-bordertype="boxShadow"><img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/630a705a3251efc66b468b179a88d241.jpeg"> <div data-title="">当前进程打开的文件描述符</div></div></div><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><h3 data-id="heading2" data-type="heading" top="888.25">用户态和内核态</h3><ol data-type="numberedlist"><li><p data-number="1" data-type="paragraph">内存被划分为内核态和用户态，数据在用户态和内核态之间拷贝，内核态可以访问用户态数据，反之不可以</p></li><li><p data-number="2" data-type="paragraph">用户态无法直接访问磁盘、网卡等设备，必须通过系统提供的 syscall 方式调用系统函数</p></li></ol><div data-type="image"><div data-content="" data-style-width="100%" data-style-bordertype="boxShadow"><img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/fd79a5af8b98f0439492dd3fbe328d01.png"> <!----></div></div><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><h3 data-id="heading3" data-type="heading" top="1097.25">系统调用</h3><p data-type="paragraph">我们来执行如下 Java 代码，看看系统会发生什么：</p><div data-type="codeblock"><div data-codeblock-wrap=""><div data-codeblock-codes=""><div class="simplebar" data-simplebar="init"><div class="simplebar-wrapper" style="margin: 0px;"><div class="simplebar-height-auto-observer-wrapper"><div class="simplebar-height-auto-observer"></div></div> <div class="simplebar-mask"><div class="simplebar-offset" style="right: 0px; bottom: 0px;"><div class="simplebar-content-wrapper" style="height: auto; overflow: hidden scroll;"><div class="simplebar-content" style="padding: 0px;"><div><pre data-origin="pm_code_preview" lang="java"><code data-type="codeline"><span data-type="markclass" class="hljs-keyword">import</span> java.io.IOException;</code><code data-type="codeline"><span data-type="markclass" class="hljs-keyword">import</span> java.net.ServerSocket;</code><code data-type="codeline"><br class="ProseMirror-trailingBreak"></code><code data-type="codeline"><span data-type="markclass" class="hljs-keyword">public</span> <span data-type="markclass" class="hljs-keyword">class</span> <span data-type="markclass" class="hljs-title class_">BIOServer</span> {</code><code data-type="codeline">    <span data-type="markclass" class="hljs-keyword">public</span> <span data-type="markclass" class="hljs-keyword">static</span> <span data-type="markclass" class="hljs-keyword">void</span> <span data-type="markclass" class="hljs-title function_">main</span><span data-type="markclass" class="hljs-params">(String[] args)</span> <span data-type="markclass" class="hljs-keyword">throws</span> IOException {</code><code data-type="codeline">        <span data-type="markclass" class="hljs-type">ServerSocket</span> <span data-type="markclass" class="hljs-variable">server</span> <span data-type="markclass" class="hljs-operator">=</span> <span data-type="markclass" class="hljs-keyword">new</span> <span data-type="markclass" class="hljs-title class_">ServerSocket</span>(<span data-type="markclass" class="hljs-number">8080</span>);</code><code data-type="codeline">        server.accept();</code><code data-type="codeline">    }</code><code data-type="codeline">}</code></pre></div></div></div></div></div> <div class="simplebar-placeholder" style="width: 770px; height: 190px;"></div></div> <div class="simplebar-track simplebar-horizontal" style="visibility: hidden;"><div class="simplebar-scrollbar simplebar-visible" style="width: 0px; display: none;"></div></div> <div class="simplebar-track simplebar-vertical" style="visibility: visible;"><div class="simplebar-scrollbar simplebar-visible" style="height: 0px; display: none;"></div></div></div></div> <div data-codeblock-copy="">复制代码</div> <div data-codeblock-index=""><div data-codeblock-number="1"></div><div data-codeblock-number="2"></div><div data-codeblock-number="3"></div><div data-codeblock-number="4"></div><div data-codeblock-number="5"></div><div data-codeblock-number="6"></div><div data-codeblock-number="7"></div><div data-codeblock-number="8"></div><div data-codeblock-number="9"></div></div></div></div><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><p data-type="paragraph">利用 strace 获取系统函数调用栈：</p><div data-type="codeblock"><div data-codeblock-wrap=""><div data-codeblock-codes=""><div class="simplebar" data-simplebar="init"><div class="simplebar-wrapper" style="margin: 0px;"><div class="simplebar-height-auto-observer-wrapper"><div class="simplebar-height-auto-observer"></div></div> <div class="simplebar-mask"><div class="simplebar-offset" style="right: 0px; bottom: 0px;"><div class="simplebar-content-wrapper" style="height: auto; overflow: hidden scroll;"><div class="simplebar-content" style="padding: 0px;"><div><pre data-origin="pm_code_preview" lang="shell"><code data-type="codeline">strace -ff -o out java BIOServer</code></pre></div></div></div></div></div> <div class="simplebar-placeholder" style="width: 770px; height: 30px;"></div></div> <div class="simplebar-track simplebar-horizontal" style="visibility: hidden;"><div class="simplebar-scrollbar simplebar-visible" style="width: 0px; display: none;"></div></div> <div class="simplebar-track simplebar-vertical" style="visibility: visible;"><div class="simplebar-scrollbar simplebar-visible" style="height: 0px; display: none;"></div></div></div></div> <div data-codeblock-copy="">复制代码</div> <div data-codeblock-index=""><div data-codeblock-number="1"></div></div></div></div><p data-type="paragraph"> </p><p data-type="paragraph">查看生成的文件，找到关键信息行：</p><div data-type="codeblock"><div data-codeblock-wrap=""><div data-codeblock-codes=""><div class="simplebar" data-simplebar="init"><div class="simplebar-wrapper" style="margin: 0px;"><div class="simplebar-height-auto-observer-wrapper"><div class="simplebar-height-auto-observer"></div></div> <div class="simplebar-mask"><div class="simplebar-offset" style="right: 0px; bottom: 0px;"><div class="simplebar-content-wrapper" style="height: auto; overflow: hidden scroll;"><div class="simplebar-content" style="padding: 0px;"><div><pre data-origin="pm_code_preview" lang="shell"><code data-type="codeline">socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 5</code><code data-type="codeline"><span data-type="markclass" class="hljs-built_in">bind</span>(5, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr(<span data-type="markclass" class="hljs-string">"0.0.0.0"</span>)}, 16) = 0</code><code data-type="codeline">listen(5, 50)</code></pre></div></div></div></div></div> <div class="simplebar-placeholder" style="width: 770px; height: 70px;"></div></div> <div class="simplebar-track simplebar-horizontal" style="visibility: hidden;"><div class="simplebar-scrollbar simplebar-visible" style="width: 0px; display: none;"></div></div> <div class="simplebar-track simplebar-vertical" style="visibility: visible;"><div class="simplebar-scrollbar simplebar-visible" style="height: 0px; display: none;"></div></div></div></div> <div data-codeblock-copy="">复制代码</div> <div data-codeblock-index=""><div data-codeblock-number="1"></div><div data-codeblock-number="2"></div><div data-codeblock-number="3"></div></div></div></div><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><p data-type="paragraph">这里出现了 3 个系统函数，socket，bind，listen。我们分别查看 Linux 手册：</p><ul data-type="bulletedlist"><li><p data-type="paragraph">socket</p></li></ul><div data-type="codeblock"><div data-codeblock-wrap=""><div data-codeblock-codes=""><div class="simplebar" data-simplebar="init"><div class="simplebar-wrapper" style="margin: 0px;"><div class="simplebar-height-auto-observer-wrapper"><div class="simplebar-height-auto-observer"></div></div> <div class="simplebar-mask"><div class="simplebar-offset" style="right: 0px; bottom: 0px;"><div class="simplebar-content-wrapper" style="height: auto; overflow: scroll;"><div class="simplebar-content" style="padding: 0px;"><div><pre data-origin="pm_code_preview" lang="text"><code data-type="codeline">NAME</code><code data-type="codeline">       socket - create an endpoint for communication</code><code data-type="codeline">       </code><code data-type="codeline">DESCRIPTION</code><code data-type="codeline">       socket() creates an endpoint for communication and returns a descriptor.</code><code data-type="codeline"><br class="ProseMirror-trailingBreak"></code><code data-type="codeline">RETURN VALUE</code><code data-type="codeline">       On  success,  a  file  descriptor for the new socket is returned.  On error, -1 is returned, and errno is set appropri-</code><code data-type="codeline">       ately.</code></pre></div></div></div></div></div> <div class="simplebar-placeholder" style="width: 770px; height: 190px;"></div></div> <div class="simplebar-track simplebar-horizontal" style="visibility: visible;"><div class="simplebar-scrollbar simplebar-visible" style="width: 603px; display: block; transform: translate3d(0px, 0px, 0px);"></div></div> <div class="simplebar-track simplebar-vertical" style="visibility: visible;"><div class="simplebar-scrollbar simplebar-visible" style="height: 0px; display: none;"></div></div></div></div> <div data-codeblock-copy="">复制代码</div> <div data-codeblock-index=""><div data-codeblock-number="1"></div><div data-codeblock-number="2"></div><div data-codeblock-number="3"></div><div data-codeblock-number="4"></div><div data-codeblock-number="5"></div><div data-codeblock-number="6"></div><div data-codeblock-number="7"></div><div data-codeblock-number="8"></div><div data-codeblock-number="9"></div></div></div></div><p data-type="paragraph">socket() 为通信提供一个终点并且返回一个<span data-name="red" style="color: #F5222D" data-type="color"><strong data-type="strong">文件描述符 fd</strong></span>，否则返回 -1</p><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><ul data-type="bulletedlist"><li><p data-type="paragraph">bind</p></li></ul><div data-type="codeblock"><div data-codeblock-wrap=""><div data-codeblock-codes=""><div class="simplebar" data-simplebar="init"><div class="simplebar-wrapper" style="margin: 0px;"><div class="simplebar-height-auto-observer-wrapper"><div class="simplebar-height-auto-observer"></div></div> <div class="simplebar-mask"><div class="simplebar-offset" style="right: 0px; bottom: 0px;"><div class="simplebar-content-wrapper" style="height: auto; overflow: scroll;"><div class="simplebar-content" style="padding: 0px;"><div><pre data-origin="pm_code_preview" lang="text"><code data-type="codeline">NAME</code><code data-type="codeline">       bind - bind a name to a socket</code><code data-type="codeline">       </code><code data-type="codeline">SYNOPSIS</code><code data-type="codeline">       #include &lt;sys/types.h&gt;          /* See NOTES */</code><code data-type="codeline">       #include &lt;sys/socket.h&gt;</code><code data-type="codeline"><br class="ProseMirror-trailingBreak"></code><code data-type="codeline">       int bind(int sockfd, const struct sockaddr *addr,</code><code data-type="codeline">                socklen_t addrlen);</code><code data-type="codeline"><br class="ProseMirror-trailingBreak"></code><code data-type="codeline">DESCRIPTION</code><code data-type="codeline">       When  a socket is created with socket(2), it exists in a name space (address family) but has no address assigned to it.</code><code data-type="codeline">       bind() assigns the address specified by addr to the socket referred to by the file descriptor sockfd.   addrlen  speci-</code><code data-type="codeline">       fies the size, in bytes, of the address structure pointed to by addr.  Traditionally, this operation is called "assign-</code><code data-type="codeline">       ing a name to a socket".</code><code data-type="codeline">       </code><code data-type="codeline">RETURN VALUE</code><code data-type="codeline">       On success, zero is returned.  On error, -1 is returned, and errno is set appropriately.</code></pre></div></div></div></div></div> <div class="simplebar-placeholder" style="width: 770px; height: 370px;"></div></div> <div class="simplebar-track simplebar-horizontal" style="visibility: visible;"><div class="simplebar-scrollbar simplebar-visible" style="width: 603px; display: block; transform: translate3d(0px, 0px, 0px);"></div></div> <div class="simplebar-track simplebar-vertical" style="visibility: visible;"><div class="simplebar-scrollbar simplebar-visible" style="height: 0px; display: none;"></div></div></div></div> <div data-codeblock-copy="">复制代码</div> <div data-codeblock-index=""><div data-codeblock-number="1"></div><div data-codeblock-number="2"></div><div data-codeblock-number="3"></div><div data-codeblock-number="4"></div><div data-codeblock-number="5"></div><div data-codeblock-number="6"></div><div data-codeblock-number="7"></div><div data-codeblock-number="8"></div><div data-codeblock-number="9"></div><div data-codeblock-number="10"></div><div data-codeblock-number="11"></div><div data-codeblock-number="12"></div><div data-codeblock-number="13"></div><div data-codeblock-number="14"></div><div data-codeblock-number="15"></div><div data-codeblock-number="16"></div><div data-codeblock-number="17"></div><div data-codeblock-number="18"></div></div></div></div><p data-type="paragraph">bind()，接受三个参数（<span data-name="red" style="color: #F5222D" data-type="color"><strong data-type="strong">socket 返回的文件描述符</strong></span>，socket 地址结构体，socket 地址长度），成功返回 0</p><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><ul data-type="bulletedlist"><li><p data-type="paragraph">listen</p></li></ul><div data-type="codeblock"><div data-codeblock-wrap=""><div data-codeblock-codes=""><div class="simplebar" data-simplebar="init"><div class="simplebar-wrapper" style="margin: 0px;"><div class="simplebar-height-auto-observer-wrapper"><div class="simplebar-height-auto-observer"></div></div> <div class="simplebar-mask"><div class="simplebar-offset" style="right: 0px; bottom: 0px;"><div class="simplebar-content-wrapper" style="height: auto; overflow: scroll;"><div class="simplebar-content" style="padding: 0px;"><div><pre data-origin="pm_code_preview" lang="text"><code data-type="codeline">NAME</code><code data-type="codeline">       listen - listen for connections on a socket</code><code data-type="codeline"><br class="ProseMirror-trailingBreak"></code><code data-type="codeline">SYNOPSIS</code><code data-type="codeline">       #include &lt;sys/types.h&gt;          /* See NOTES */</code><code data-type="codeline">       #include &lt;sys/socket.h&gt;</code><code data-type="codeline"><br class="ProseMirror-trailingBreak"></code><code data-type="codeline">       int listen(int sockfd, int backlog);</code><code data-type="codeline">       </code><code data-type="codeline">DESCRIPTION</code><code data-type="codeline">       listen()  marks  the socket referred to by sockfd as a passive socket, that is, as a socket that will be used to accept</code><code data-type="codeline">       incoming connection requests using accept(2).</code><code data-type="codeline"><br class="ProseMirror-trailingBreak"></code><code data-type="codeline">       The sockfd argument is a file descriptor that refers to a socket of type SOCK_STREAM or SOCK_SEQPACKET.</code><code data-type="codeline"><br class="ProseMirror-trailingBreak"></code><code data-type="codeline">       The backlog argument defines the maximum length to which the queue of pending connections for sockfd may  grow.   If  a</code><code data-type="codeline">       connection  request  arrives when the queue is full, the client may receive an error with an indication of ECONNREFUSED</code><code data-type="codeline">       or, if the underlying protocol supports retransmission, the request may be ignored so that a later reattempt at connec-</code><code data-type="codeline">       tion succeeds.</code><code data-type="codeline"><br class="ProseMirror-trailingBreak"></code><code data-type="codeline">RETURN VALUE</code><code data-type="codeline">       On success, zero is returned.  On error, -1 is returned, and errno is set appropriately.</code></pre></div></div></div></div></div> <div class="simplebar-placeholder" style="width: 770px; height: 450px;"></div></div> <div class="simplebar-track simplebar-horizontal" style="visibility: visible;"><div class="simplebar-scrollbar simplebar-visible" style="width: 603px; display: block; transform: translate3d(0px, 0px, 0px);"></div></div> <div class="simplebar-track simplebar-vertical" style="visibility: visible;"><div class="simplebar-scrollbar simplebar-visible" style="height: 0px; display: none;"></div></div></div></div> <div data-codeblock-copy="">复制代码</div> <div data-codeblock-index=""><div data-codeblock-number="1"></div><div data-codeblock-number="2"></div><div data-codeblock-number="3"></div><div data-codeblock-number="4"></div><div data-codeblock-number="5"></div><div data-codeblock-number="6"></div><div data-codeblock-number="7"></div><div data-codeblock-number="8"></div><div data-codeblock-number="9"></div><div data-codeblock-number="10"></div><div data-codeblock-number="11"></div><div data-codeblock-number="12"></div><div data-codeblock-number="13"></div><div data-codeblock-number="14"></div><div data-codeblock-number="15"></div><div data-codeblock-number="16"></div><div data-codeblock-number="17"></div><div data-codeblock-number="18"></div><div data-codeblock-number="19"></div><div data-codeblock-number="20"></div><div data-codeblock-number="21"></div><div data-codeblock-number="22"></div></div></div></div><p data-type="paragraph">listen()，接受两个参数（<span data-name="red" style="color: #F5222D" data-type="color"><strong data-type="strong">socket 返回的文件描述符</strong></span>，接受 socket 队列的大小），成功返回 0，失败返回-1</p><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><p data-type="paragraph">重新来看三个函数调用的关系，应该是：</p><div data-type="image"><div data-content="" data-style-width="100%" data-style-bordertype="boxShadow"><img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/d386f32bde57adaa5df29d75fcc2091c.png"> <div data-title="">系统函数调用关系</div></div></div><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><p data-type="paragraph">查看 Java 进程下的文件描述符：</p><div data-type="image"><div data-content="" data-style-width="100%" data-style-bordertype="boxShadow"><img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/a8c6002e979c9b1959ac03d364dc370c.png"> <div data-title="">5号fd指向一个socket</div></div></div><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><p data-type="paragraph">可以得出以下结论：</p><p data-type="paragraph">1、Java 中通过对系统的调用来实现网络 IO</p><p data-type="paragraph">2、ServerSocket server = new ServerSocket(8080); 一行 Java 代码的背后，经过了多个系统函数调用</p><p data-type="paragraph">3、<span data-name="red" style="color: #F5222D" data-type="color"><strong data-type="strong">实现网络 IO，不是 Java 的能力，是操作系统内核提供的能力</strong></span></p><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><div data-type="image"><div data-content="" data-style-width="100%" data-style-bordertype="boxShadow"><img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/ac3de7f43f45372c7279227931aee986.png"> <!----></div></div><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><h3 data-id="heading4" data-type="heading" top="2539.85009765625">备忘录</h3><ol data-type="numberedlist"><li><p data-number="1" data-type="paragraph"><span data-size="12" data-type="size"><strong data-type="strong">Linux 中都是文件描述符</strong></span></p></li><li><p data-number="2" data-type="paragraph"><span data-size="12" data-type="size"><strong data-type="strong">用户空间的程序，通过调用系统函数来访问操作系统软硬件资源</strong></span></p></li><li><p data-number="3" data-type="paragraph"><span data-size="12" data-type="size"><strong data-type="strong">提供网络 IO 能力的不是 Java/Python 高级语言而是 Linux Kernel</strong></span></p></li></ol><p data-number="4" data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><h2 data-id="heading5" data-type="heading" top="2741.10009765625">系列</h2><p data-type="paragraph"><strong data-type="strong"><a href="https://xie.infoq.cn/article/0e36ad9712c8d9ad8f7a7c570" title="" data-type="link">NIO 看破也说破（一）—— Linux/IO 基础</a></strong><br class="ProseMirror-trailingBreak"></p><p data-type="paragraph"><strong data-type="strong"><a href="https://xie.infoq.cn/article/e8ab7c9020253b83355c10661" title="" data-type="link">NIO 看破也说破（二）—— Java 中的两种 BIO</a></strong><br class="ProseMirror-trailingBreak"></p><p data-type="paragraph"><strong data-type="strong"><a href="https://xie.infoq.cn/article/1f44643161e1666b6a30b85e7" title="" data-type="link">NIO 看破也说破（三）—— 不同的 IO 模型</a></strong><br class="ProseMirror-trailingBreak"></p><p data-type="paragraph"><a href="https://xie.infoq.cn/article/b9baa25c9d506e4a1cb459fe0" title="" data-type="link">NIO 看破也说破（四）—— Java 的 NIO</a><br class="ProseMirror-trailingBreak"></p><p data-type="paragraph"><p data-type="paragraph"><strong data-type="strong"><a href="https://xie.infoq.cn/article/9e57819677d77f9a34852f6e9" title="" data-type="link">NIO 看破也说破（五）： 搞，今天就搞，搞懂Buffer</a></strong><br class="ProseMirror-trailingBreak"></p><br class="ProseMirror-trailingBreak"></p><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><h2 data-id="heading6" data-type="heading" top="3025.10009765625">关注我</h2><p data-type="paragraph">如果您在微信阅读，请您点击链接 <a href="https://xie.infoq.cn/link?target=https%3A%2F%2Fmp.weixin.qq.com%2Fmp%2Fprofile_ext%3Faction%3Dhome%26__biz%3DMzI3MDYwOTYwOA%3D%3D%26scene%3D110%23wechat_redirect" title="" data-type="link">关注我</a> ，如果您在 PC 上阅读请扫码关注我，欢迎与我交流随时指出错误</p><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p><div data-type="image"><div data-content="" data-style-width="25%" data-style-bordertype="boxShadow"><img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/3874eef202c2e5d161059dcf58e1430f.png"> <!----></div></div><p data-type="paragraph"><br class="ProseMirror-trailingBreak"></p></div></div><div data-v-759cadff="" data-v-fbbc0218="" class="selection-operation-bar note-bar popup-note-menu up" style="top: 429.25px; left: 106px;"><div data-v-759cadff="" class="arrow up" style="left: 94px;"></div><div data-v-759cadff="" class="main"><div data-v-759cadff="" class="menu line"><i data-v-a949bb52="" data-v-759cadff="" class="com-icon iconfont icon-hover" style="font-size: 20px; color: rgb(255, 255, 255);"></i><span data-v-759cadff="" class="text">划线</span></div><!----><div data-v-759cadff="" class="menu comment"><i data-v-a949bb52="" data-v-759cadff="" class="com-icon iconfont icon-hover" style="font-size: 20px; color: rgb(255, 255, 255);"></i><span data-v-759cadff="" class="text">评论</span></div><div data-v-759cadff="" class="menu copy"><i data-v-a949bb52="" data-v-759cadff="" class="com-icon iconfont icon-hover" style="font-size: 20px; color: rgb(255, 255, 255);"></i><span data-v-759cadff="" class="text">复制</span></div></div></div></div></div><div data-v-4a1c10f0="" data-v-b110a92e="" class="author-information after-content"><div data-v-4a1c10f0="" data-v-b110a92e="" class="row"><span data-v-4a1c10f0="" data-v-b110a92e="" class="date">发布于: 2020-05-05</span><span data-v-4a1c10f0="" data-v-b110a92e="" class="views">阅读数: 4470</span></div></div><div data-v-4a1c10f0="" data-v-b110a92e="" class="copyright"><p data-v-4a1c10f0="" data-v-b110a92e="">版权声明: 本文为 InfoQ 作者【小眼睛聊技术】的原创文章。</p><p data-v-4a1c10f0="" data-v-b110a92e="">原文链接:【<a href="https://xie.infoq.cn/article/0e36ad9712c8d9ad8f7a7c570" target="_blank">https://xie.infoq.cn/article/0e36ad9712c8d9ad8f7a7c570</a>】。文章转载请联系作者。</p></div><!----><div data-v-4300d745="" data-v-4a1c10f0="" class="com-label-list tag-list" data-v-b110a92e=""><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/182" com-label-title="" class="com-label-title">Linux</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/238" com-label-title="" class="com-label-title">架构</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/531" com-label-title="" class="com-label-title">后端</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/678" com-label-title="" class="com-label-title">Netty</a><a data-v-4426e0e8="" data-v-4300d745="" href="https://xie.infoq.cn/tag/975" com-label-title="" class="com-label-title">nio</a></div><div data-v-affe19d2="" data-v-4a1c10f0="" author-card="" class="com-author-card author-info" data-v-b110a92e=""><div data-v-affe19d2="" class="author-card"><div data-v-affe19d2="" class="top"><div data-v-affe19d2="" class="avatar"><div data-v-7b3025e7="" data-v-affe19d2="" class="com-avatar-wrap"><img data-v-7b3025e7="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/449a9571.jpg" alt="用户头像" class="com-avatar" style="width: 55px; height: 55px;"><!----></div></div><div data-v-affe19d2="" class="info"><div data-v-affe19d2="" class="top"><h3 data-v-affe19d2="" class="author-name"><span data-v-3bc80670="" data-v-6281d13f="" data-v-affe19d2="" class="ctn"><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">小眼睛聊技术</a><!----></span></h3><div data-v-d2847db8="" data-v-affe19d2="" gk-button="" gkbtn-color="unfollow" gkbtn-size="small" class="geek-foll-btn Button_button_3onsJ" follow-button="" data-follow="0"><i data-v-affe19d2="" class="iconfont"></i>关注</div></div><p data-v-affe19d2="" class="mood"> 欢迎关注公众号“小眼睛聊技术” <span data-v-affe19d2="" class="dot"></span> 2018-11-12 加入</p></div></div><!----><p data-v-affe19d2="" class="intro">互联网老兵，关注产品、技术、管理</p></div></div><div data-v-4a51d84b="" data-v-4a1c10f0="" class="widget-operation-bottom widget-operation inner" info="[object Object]" wxshareurl="https://xie.infoq.cn/article/0e36ad9712c8d9ad8f7a7c570" data-v-b110a92e=""><!----><div data-v-4a51d84b="" class="like btn"><i data-v-4a51d84b="" class="iconfont"></i><!----></div><div data-v-4a51d84b="" class="favorite btn"><i data-v-4a51d84b="" class="iconfont"></i></div><!----><div data-v-4a51d84b="" class="weixin btn"><span data-v-4a51d84b="" class="gkui-popup share-popup-top share-popup"><i data-v-4a51d84b="" class="iconfont"></i><!----></span></div><div data-v-4a51d84b="" class="weibo btn"><i data-v-4a51d84b="" class="iconfont"></i></div><div data-v-4a51d84b="" class="horde btn"><i data-v-4a51d84b="" class="iconfont"></i></div><div data-v-4a51d84b="" data-self="2" data-label="举报" class="extra btn"><i data-v-4a51d84b="" class="iconfont"></i></div><!----></div><!----><div data-v-b7e0eae6="" data-v-4a1c10f0="" class="article-comment-block comment-list-wrap" data-v-b110a92e=""><div data-v-b7e0eae6="" class="comment-list"><h2 data-v-b7e0eae6="">评论 <span data-v-b7e0eae6="" class="comment-number">(7 条评论)</span></h2><div data-v-b7e0eae6="" class="comment-form"><div data-v-b7e0eae6="" class="comment-input no-reference"><div data-v-045f148c="" data-v-b7e0eae6="" contenteditable="plaintext-only" spellcheck="false" placeholder="写下你的想法，一起交流" class="textarea comment-textarea empty"></div> <!----></div><div data-v-b7e0eae6="" class="comment-operation"><div data-v-b7e0eae6="" gk-button="" gkbtn-color="green" gkbtn-size="normal" disabled="disabled" class="comment-btn Button_button_3onsJ"> 发布 </div></div></div><div data-v-b7e0eae6="" class="list"><!----><div data-v-fcafb8d2="" data-v-54bade26="" data-v-b7e0eae6="" class="reply-item comment-item"><div data-v-54bade26="" data-v-fcafb8d2="" class="comment-avatar"><div data-v-7b3025e7="" data-v-54bade26="" class="com-avatar-wrap" data-v-fcafb8d2=""><img data-v-7b3025e7="" src="" alt="用户头像" class="com-avatar" style="width: 40px; height: 40px;"><!----></div></div><div data-v-fcafb8d2="" class="reply-author"><span data-v-3bc80670="" data-v-6281d13f="" data-v-fcafb8d2="" class="ctn reply-user"><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">释水</a><!----></span><!----></div><div data-v-fcafb8d2="" class="reply-content"><span data-v-fcafb8d2="" class="">厉害，涨知识了</span><!----></div><div data-v-fcafb8d2="" class="reply-operation"><div data-v-fcafb8d2="" class="date">2020-05-10 22:20 <!----></div><div data-v-fcafb8d2="" class="reply-action"><span data-v-fcafb8d2="" class="like-btn"><i data-v-fcafb8d2="" class="iconfont"></i> 0 </span><span data-v-fcafb8d2="" class="reply-btn"><i data-v-fcafb8d2="" class="iconfont"></i><em data-v-fcafb8d2="">回复</em></span></div></div><!----></div><div data-v-fcafb8d2="" data-v-54bade26="" data-v-b7e0eae6="" class="reply-item comment-item"><div data-v-54bade26="" data-v-fcafb8d2="" class="comment-avatar"><div data-v-7b3025e7="" data-v-54bade26="" class="com-avatar-wrap" data-v-fcafb8d2=""><img data-v-7b3025e7="" src="" alt="用户头像" class="com-avatar" style="width: 40px; height: 40px;"><!----></div></div><div data-v-fcafb8d2="" class="reply-author"><span data-v-3bc80670="" data-v-6281d13f="" data-v-fcafb8d2="" class="ctn reply-user"><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">InfoQ_0049a36cb818</a><!----></span><!----></div><div data-v-fcafb8d2="" class="reply-content"><span data-v-fcafb8d2="" class="">你好，文件描述符应该是： file descriptor吧</span><!----></div><div data-v-fcafb8d2="" class="reply-operation"><div data-v-fcafb8d2="" class="date">2020-05-08 14:36 <!----></div><div data-v-fcafb8d2="" class="reply-action"><span data-v-fcafb8d2="" class="like-btn"><i data-v-fcafb8d2="" class="iconfont"></i> 0 </span><span data-v-fcafb8d2="" class="reply-btn"><i data-v-fcafb8d2="" class="iconfont"></i><em data-v-fcafb8d2="">回复</em></span></div></div><!----><div data-v-54bade26="" data-v-fcafb8d2="" class="reply-list"><span data-v-54bade26="" data-v-fcafb8d2=""><div data-v-fcafb8d2="" data-v-54bade26="" class="reply-item"><div data-v-fcafb8d2="" class="reply-author"><span data-v-3bc80670="" data-v-6281d13f="" data-v-fcafb8d2="" class="ctn reply-user"><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">小眼睛聊技术</a><!----></span><!----></div><div data-v-fcafb8d2="" class="reply-content"><span data-v-fcafb8d2="" class="">是的，是哪里有错误吗</span><!----></div><div data-v-fcafb8d2="" class="reply-operation"><div data-v-fcafb8d2="" class="date">2020-05-08 18:52 <!----></div><div data-v-fcafb8d2="" class="reply-action"><span data-v-fcafb8d2="" class="like-btn"><i data-v-fcafb8d2="" class="iconfont"></i> 0 </span><span data-v-fcafb8d2="" class="reply-btn"><i data-v-fcafb8d2="" class="iconfont"></i><em data-v-fcafb8d2="">回复</em></span></div></div><!----></div><div data-v-fcafb8d2="" data-v-54bade26="" class="reply-item"><div data-v-fcafb8d2="" class="reply-author"><span data-v-3bc80670="" data-v-6281d13f="" data-v-fcafb8d2="" class="ctn reply-user"><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">InfoQ_0049a36cb818</a><!----></span><span data-v-fcafb8d2="" class="reply-label">回复</span><span data-v-3bc80670="" data-v-6281d13f="" data-v-fcafb8d2="" class="ctn reply-user"><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">小眼睛聊技术</a><!----></span></div><div data-v-fcafb8d2="" class="reply-content"><span data-v-fcafb8d2="" class="">图片： 文件描述符映射关系</span><!----></div><div data-v-fcafb8d2="" class="reply-operation"><div data-v-fcafb8d2="" class="date">2020-05-11 10:20 <!----></div><div data-v-fcafb8d2="" class="reply-action"><span data-v-fcafb8d2="" class="like-btn"><i data-v-fcafb8d2="" class="iconfont"></i> 0 </span><span data-v-fcafb8d2="" class="reply-btn"><i data-v-fcafb8d2="" class="iconfont"></i><em data-v-fcafb8d2="">回复</em></span></div></div><!----></div><div data-v-fcafb8d2="" data-v-54bade26="" class="reply-item"><div data-v-fcafb8d2="" class="reply-author"><span data-v-3bc80670="" data-v-6281d13f="" data-v-fcafb8d2="" class="ctn reply-user"><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">小眼睛聊技术</a><!----></span><span data-v-fcafb8d2="" class="reply-label">回复</span><span data-v-3bc80670="" data-v-6281d13f="" data-v-fcafb8d2="" class="ctn reply-user"><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">InfoQ_0049a36cb818</a><!----></span></div><div data-v-fcafb8d2="" class="reply-content"><span data-v-fcafb8d2="" class="">已更新，感谢指正</span><!----></div><div data-v-fcafb8d2="" class="reply-operation"><div data-v-fcafb8d2="" class="date">2020-05-19 17:26 <!----></div><div data-v-fcafb8d2="" class="reply-action"><span data-v-fcafb8d2="" class="like-btn"><i data-v-fcafb8d2="" class="iconfont"></i> 0 </span><span data-v-fcafb8d2="" class="reply-btn"><i data-v-fcafb8d2="" class="iconfont"></i><em data-v-fcafb8d2="">回复</em></span></div></div><!----></div></span><!----></div></div><div data-v-fcafb8d2="" data-v-54bade26="" data-v-b7e0eae6="" class="reply-item comment-item"><div data-v-54bade26="" data-v-fcafb8d2="" class="comment-avatar"><div data-v-7b3025e7="" data-v-54bade26="" class="com-avatar-wrap" data-v-fcafb8d2=""><img data-v-7b3025e7="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/4d780f27.jpg" alt="用户头像" class="com-avatar" style="width: 40px; height: 40px;"><!----></div></div><div data-v-fcafb8d2="" class="reply-author"><span data-v-3bc80670="" data-v-6281d13f="" data-v-fcafb8d2="" class="ctn reply-user"><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">乐白</a><!----></span><!----></div><div data-v-fcafb8d2="" class="reply-content"><span data-v-fcafb8d2="" class="">您好，我是InfoQ网站运营编辑，这个系列文章很不错，我想推荐到InfoQ官网首页。标题中的 - （横杠）建议改成 ：（冒号）或破折号（——）全角中文。头图尽量配上一个漂亮一些的，这样展示效果更好。</span><!----></div><div data-v-fcafb8d2="" class="reply-operation"><div data-v-fcafb8d2="" class="date">2020-05-07 17:11 <!----></div><div data-v-fcafb8d2="" class="reply-action"><span data-v-fcafb8d2="" class="like-btn"><i data-v-fcafb8d2="" class="iconfont"></i> 0 </span><span data-v-fcafb8d2="" class="reply-btn"><i data-v-fcafb8d2="" class="iconfont"></i><em data-v-fcafb8d2="">回复</em></span></div></div><!----><div data-v-54bade26="" data-v-fcafb8d2="" class="reply-list"><span data-v-54bade26="" data-v-fcafb8d2=""><div data-v-fcafb8d2="" data-v-54bade26="" class="reply-item"><div data-v-fcafb8d2="" class="reply-author"><span data-v-3bc80670="" data-v-6281d13f="" data-v-fcafb8d2="" class="ctn reply-user"><a data-v-3bc80670="" rel="nofollow" com-author-name="" class="com-author-name">小眼睛聊技术</a><!----></span><!----></div><div data-v-fcafb8d2="" class="reply-content"><span data-v-fcafb8d2="" class="">已经按照您的建议修改了，辛苦再提出些建议</span><!----></div><div data-v-fcafb8d2="" class="reply-operation"><div data-v-fcafb8d2="" class="date">2020-05-07 18:16 <!----></div><div data-v-fcafb8d2="" class="reply-action"><span data-v-fcafb8d2="" class="like-btn"><i data-v-fcafb8d2="" class="iconfont"></i> 1 </span><span data-v-fcafb8d2="" class="reply-btn"><i data-v-fcafb8d2="" class="iconfont"></i><em data-v-fcafb8d2="">回复</em></span></div></div><!----></div></span><!----></div></div><div data-v-4c7bd645="" data-v-b7e0eae6="" class="com-more-button loading-btn"><span data-v-4c7bd645="" class="finish-label">没有更多了</span></div></div></div></div><!----></div><!----><div data-v-4449d9fe="" data-v-4a1c10f0="" id="gk-layer" gkmodal-color="common" class="report-modal Modal_gk-modal_3ly5T" data-v-b110a92e=""><!----><!----></div><div data-v-355438c6="" data-v-4a1c10f0="" id="gk-layer" gkmodal-color="base" class="share-weixin-modal Modal_gk-modal_3ly5T" data-v-b110a92e=""><!----><!----></div><div data-v-4b5aad81="" data-v-4a1c10f0="" id="gk-layer" gkmodal-color="base" class="modal-share-horde Modal_gk-modal_3ly5T" data-v-b110a92e=""><!----><!----></div><!----></div><!----><div data-v-0dc6ee4d="" data-v-4a1c10f0="" class="nps-score" data-v-b110a92e=""><div data-v-0dc6ee4d="" id="gk-layer" gkmodal-color="common" class="nps-modal Modal_gk-modal_3ly5T"><!----><!----></div><div data-v-0dc6ee4d="" id="gk-layer" gkmodal-color="common" class="nps-modal-thank Modal_gk-modal_3ly5T"><!----><!----></div></div></div><div data-v-b110a92e="" id="check-bottom-bar"></div><div data-v-b110a92e="" layout-footer-wrap="" class="layout-footer-wrap"><div data-v-c5384832="" data-v-b110a92e="" class="footer layout-footer"><ul data-v-c5384832="" class="layout-content"><li data-v-c5384832="" class="theme"><div data-v-c5384832="" class="logo"><img data-v-c5384832="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/logo.3bdee6e4.png" alt="logo"><p data-v-c5384832="">促进软件开发及相关领域知识与创新的传播</p></div></li><li data-v-c5384832=""><dl data-v-c5384832="" class="footer-nav"><dt data-v-c5384832="">InfoQ</dt><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="https://www.infoq.cn/about" target="_blank" rel="noopener nofollow">关于我们</a></dd><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="https://www.infoq.cn/contribute" target="_blank" rel="noopener nofollow">我要投稿</a></dd><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="https://www.geekbang.org/partner" target="_blank" rel="noopener nofollow">合作伙伴</a></dd><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="https://www.lagou.com/gongsi/j43775.html" target="_blank" rel="noopener nofollow">加入我们</a></dd><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="https://infoq.cn/official/account" target="_blank" rel="noopener nofollow">关注我们</a></dd></dl></li><li data-v-c5384832=""><dl data-v-c5384832="" class="footer-nav"><dt data-v-c5384832="">联系我们</dt><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="mailto:editors@geekbang.com" target="_blank" rel="noopener nofollow">内容投稿：editors@geekbang.com</a></dd><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="mailto:hezuo@geekbang.com" target="_blank" rel="noopener nofollow">业务合作：hezuo@geekbang.com</a></dd><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="mailto:feedback@geekbang.com" target="_blank" rel="noopener nofollow">反馈投诉：feedback@geekbang.com</a></dd><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="mailto:zhaopin@geekbang.com" target="_blank" rel="noopener nofollow">加入我们：zhaopin@geekbang.com</a></dd><dd data-v-c5384832=""><!----><span data-v-c5384832="">联系电话：010-64738142</span></dd><dd data-v-c5384832=""><!----><span data-v-c5384832="">地址：北京市朝阳区望京北路9号2幢7层A701</span></dd></dl></li><li data-v-c5384832=""><dl data-v-c5384832="" class="footer-nav"><dt data-v-c5384832="">InfoQ 近期会议</dt><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="https://qcon.infoq.cn/2024/shanghai?utm_source=infoq&amp;utm_medium=footer" target="_blank" rel="noopener nofollow">上海 · QCon 全球软件开发大会 2024.10.18-19</a></dd><dd data-v-c5384832=""><!----><a data-v-c5384832="" href="https://aicon.infoq.cn/202412/beijing/?utm_source=infoq&amp;utm_medium=footer" target="_blank" rel="noopener nofollow">北京 · AICon 全球人工智能开发与应用大会 2024.12.13-14</a></dd></dl></li><li data-v-c5384832=""><dl data-v-c5384832="" class="footer-nav"><dt data-v-c5384832="">全球 InfoQ</dt><dd data-v-c5384832=""><img data-v-c5384832="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/55cd81623e36f5ab7a7db74d60b74838.png" alt="会议图片"><a data-v-c5384832="" href="https://www.infoq.com/" target="_blank" rel="noopener nofollow">InfoQ  En</a></dd><dd data-v-c5384832=""><img data-v-c5384832="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/95fe851c02c86120e9037eada6a36d13.png" alt="会议图片"><a data-v-c5384832="" href="https://www.infoq.com/jp/" target="_blank" rel="noopener nofollow">InfoQ Jp</a></dd><dd data-v-c5384832=""><img data-v-c5384832="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/2aa440b6d94e94f64c508f16da38933e.png" alt="会议图片"><a data-v-c5384832="" href="http://www.infoq.com/fr/" target="_blank" rel="noopener nofollow">InfoQ Fr</a></dd><dd data-v-c5384832=""><img data-v-c5384832="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/4e737ce82bc7c8a1c2f2307bcea9a11e.png" alt="会议图片"><a data-v-c5384832="" href="http://www.infoq.com/br/" target="_blank" rel="noopener nofollow">InfoQ Br</a></dd></dl></li></ul><div data-v-c5384832="" class="copyright"> Copyright © 2024, Geekbang Technology Ltd. All rights reserved. 极客邦控股（北京）有限公司 | <a data-v-c5384832="" target="_blank" href="https://beian.miit.gov.cn/" class="icp"> 京 ICP 备 16027448 号 - 5</a><a data-v-c5384832="" target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010502039052"><img data-v-c5384832="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/beian.d0289dc0.png" alt="京公网安备"><span data-v-c5384832="">京公网安备 11010502039052号</span></a><a data-v-c5384832="" target="_blank" href="https://time.geekbang.org/hybrid/certificates" class="icp"> | 产品资质</a></div></div></div><div data-v-b110a92e="" id="gk-layer" gkmodal-color="common" class="offline-modal Modal_gk-modal_3ly5T"><!----><!----></div></div>
<img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/logo-121-75.yuij86g.png" alt="NIO看破也说破（一）—— Linux/IO基础_Linux_小眼睛聊技术_InfoQ写作社区" style="display: none;">
<script>
    (function (i, s, o, g, r, a, m) {
        i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
            (i[r].q = i[r].q || []).push(arguments)
        }, i[r].l = 1 * new Date(); a = s.createElement(o),
            m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
    })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
    ga('create', 'UA-103082599-11', 'auto');
    ga('send', 'pageview');
</script>
<script>
    var isRobot = /ltdgeekbang/i.test(window.navigator.userAgent.toLowerCase())
    if (!isRobot) {
        var __gBaiduSiteIdConfig__ = {
            infoq: '094d2af1d9a57fd9249b3fa259428445',
            xie: 'c53c258392315152cda6662d99774537'
        };
        var _hmt = _hmt || [];
        _hmt.push(['_setAccount', __gBaiduSiteIdConfig__.infoq]);
        _hmt.push(['_setAutoPageview', true]);
        _hmt.push(['_setAccount', __gBaiduSiteIdConfig__.xie]);
        _hmt.push(['_setAutoPageview', true]);

        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?" + __gBaiduSiteIdConfig__.infoq;
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
        
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?" + __gBaiduSiteIdConfig__.xie;
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
        
    }
</script>
<script>
    
    var isSmart = /swan\//.test(window.navigator.userAgent) || /^webswan-/.test(window.name);
    if (isSmart) {
        var smart = document.createElement("script");
        smart.src = "https://b.bdstatic.com/searchbox/icms/searchbox/js/swan-2.0.21.js";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(smart, s);
    }
</script>
<script>
    (function(para) {
        var p = para.sdk_url, n = para.name, w = window, d = document, s = 'script',x = null,y = null;
        if(typeof(w['sensorsDataAnalytic201505']) !== 'undefined') {
            return false;
        }
        w['sensorsDataAnalytic201505'] = n;
        w[n] = w[n] || function(a) {return function() {(w[n]._q = w[n]._q || []).push([a, arguments]);}};
        var ifs = ['track','quick','register','registerPage','registerOnce','trackSignup', 'trackAbtest', 'setProfile','setOnceProfile','appendProfile', 'incrementProfile', 'deleteProfile', 'unsetProfile', 'identify','login','logout','trackLink','clearAllRegister','getAppStatus'];
        for (var i = 0; i < ifs.length; i++) {
            w[n][ifs[i]] = w[n].call(null, ifs[i]);
        }
        if (!w[n]._t) {
            x = d.createElement(s), y = d.getElementsByTagName(s)[0];
            x.async = 1;
            x.src = p;
            x.setAttribute('charset','UTF-8');
            w[n].para = para;
            y.parentNode.insertBefore(x, y);
        }
    })({
        sdk_url: 'https://static.sensorsdata.cn/sdk/1.15.15/sensorsdata.min.js',
        heatmap_url: 'https://static.sensorsdata.cn/sdk/1.15.15/heatmap.min.js',
        name: 'sensors',
        server_url: 'https://sscentry.geekbang.org/sa?project=production',
        show_log: false,
        is_track_single_page: true,
        heatmap: {
            clickmap: 'not_collect',
            scroll_notice_map: 'not_collect'
        },
        preset_properties: {
            latest_referrer_host: true,
            latest_landing_page: true,
            url: true
        }
    });
</script>
<script>
    (function(win, export_obj) {
        win['LogAnalyticsObject'] = export_obj;
        if (!win[export_obj]) {
            function _collect() {
                _collect.q.push(arguments);
            }
            _collect.q = _collect.q || [];
            win[export_obj] = _collect;
        }
        win[export_obj].l = +new Date();
    })(window, 'collectEvent');
</script>
<script async="" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/collect-rangers-v5.1.4.js.下载"></script>

    <script type="text/javascript" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/main.js.下载"></script>



<div id="mantisImgViewBg" style="display: none">
			<div id="mantisImgView_header">
				<img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/rotateIcon.png" alt="" id="leftTurn">
				<img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/rotateIcon.png" alt="" id="rightTurn">
				<img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/blowUpIcon.png" alt="" id="blowUp">
				<img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/minificationIcon.png" alt="" id="minification">
			</div>
			<div id="imgBox">
				<img id="viewImg" src="https://xie.infoq.cn/article/0e36ad9712c8d9ad8f7a7c570" alt="">
			</div>
		</div><iframe id="MANTIS-CHAT-DIV" frameborder="no" style="z-index: 2147483646; position: fixed; width: 0; height: 0;box-shadow: 0 2px 25px 0 rgba(0,0,0,.3);" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/saved_resource.html"></iframe><div data-v-742c2edc="" id="gkui-message-list" style="top: 24px;"><span data-v-742c2edc=""></span></div><div id="gkui-modal-controller"><!----></div><div class="common-login-modal"><div data-v-66e08e49="" id="gk-layer" gkmodal-color="base" class="modal-login Modal_gk-modal_3ly5T"><!----><!----></div><div data-v-95b8db28="" id="gk-layer" gkmodal-color="base" class="modal-guide Modal_gk-modal_3ly5T"><!----><!----></div><div data-v-0b61e37e="" id="gk-layer" gkmodal-color="base" class="modal-receive-success Modal_gk-modal_3ly5T"><!----><!----></div><div data-v-de1e5142="" id="gk-layer" gkmodal-color="base" class="modal-rebind Modal_gk-modal_3ly5T"><!----><!----></div></div><div tabindex="-1" role="dialog" aria-hidden="true" class="pswp pswp--zoom-allowed"><div class="pswp__bg"></div><div class="pswp__scroll-wrap"><div class="pswp__container" style="transform: translate3d(0px, 0px, 0px);"><div class="pswp__item" style="display: block; transform: translate3d(-1701px, 0px, 0px);"></div><div class="pswp__item" style="transform: translate3d(0px, 0px, 0px);"><div class="pswp__zoom-wrap" style="transform: translate3d(366.6px, 202.425px, 0px) scale(0.552995);"><div class="pswp__img pswp__img--placeholder pswp__img--placeholder--blank" style="width: 1519px; height: 700px; display: none;"></div><img class="pswp__img" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/cc8a4e43a02d7deccf1ae578a61a677f.png" style="display: block; width: 1519px; height: 700px;"></div></div><div class="pswp__item" style="display: block; transform: translate3d(1701px, 0px, 0px);"></div></div><div class="pswp__ui pswp__ui--one-slide pswp__ui--hidden"><div class="pswp__top-bar"><div class="pswp__counter">1 / 1</div><button title="Close (Esc)" class="pswp__button pswp__button--close"></button><button title="Share" class="pswp__button pswp__button--share pswp__element--disabled"></button><button title="Toggle fullscreen" class="pswp__button pswp__button--fs pswp__element--disabled"></button><button title="Zoom in/out" class="pswp__button pswp__button--zoom"></button><div class="pswp__preloader"><div class="pswp__preloader__icn"><div class="pswp__preloader__cut"><div class="pswp__preloader__donut"></div></div></div></div></div><div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap pswp__element--disabled"><div class="pswp__share-tooltip"></div></div><button title="Previous (arrow left)" class="pswp__button pswp__button--arrow--left"></button><button title="Next (arrow right)" class="pswp__button pswp__button--arrow--right"></button><div class="pswp__caption pswp__element--disabled"><div class="pswp__caption__center"></div></div></div></div></div><div><div id="gk-layer" gkmodal-color="logPhone" class="Modal_gk-modal_90vUO"><!----><!----></div></div><link type="text/css" rel="stylesheet" href="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/PCMiniStyle.css"><div id="pcMsgTip" style="display:none;"><div class="pcMsgTipBox"><img id="pcMsgTipGB" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/close(1).png" alt="" onclick="mantisOnClosePCMsgList()"><div id="pcMsgTipMsgList" onclick="mantis.requestChat()"></div></div><span class="pcMsgTipAfter"> </span></div><div id="MANTIS_INV_INNER_DIV" class="mantisPcInvite_center" style="display:none;left: 50%;transform: translate(-50%,-50%);"><img src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/closeInviteIcon.png" class="closeInviteIcon" onclick="mantisHideInvite()"><img style="width:380px" src="./NIO看破也说破（一）—— Linux_IO基础_InfoQ_files/pcInvite.png" onclick="mantis.requestChat()"></div><div><template shadowrootmode="closed"><link rel="stylesheet" href="chrome-extension://ghgabhipcejejjmhhchfonmamedcbeod/fcss41/ebtn41.css"><svg width="16px" height="16px"><path id="__path" d="M16 14V2a2 2 0 00-2-2H2a2 2 0 00-2 2v12c0 1.1.9 2 2 2h12a2 2 0 002-2z"></path><path fill="#f9f6e8" d="M12.9 12.2c.2-.2.3-.5.3-.8 0-.6-.5-1.2-1.2-1.2-.3 0-.6.1-.9.4-.7.7-1.7 1-2.6 1-2 0-3.8-1.6-3.8-3.6s1.7-3.6 3.8-3.6c1 0 2 .3 2.6 1 .3.3.6.4.9.4.7 0 1.3-.5 1.3-1.2 0-.3-.2-.6-.4-.8A6.4 6.4 0 008.5 2a6.1 6.1 0 00-6.3 6c0 3.3 2.8 6 6.3 6 1.6 0 3.2-.6 4.4-1.8z"></path></svg></template></div><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><img src="" id="page-complete" style="display: none;"></body></html>